package com.hospital.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hospital.domain.pojo.Ward;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WardMapper extends BaseMapper<Ward> {
    
    @Select("SELECT * FROM ward WHERE depId = #{depId} AND wState = 1")
    List<Ward> selectByDepartment(Integer depId);
    
    @Select("SELECT * FROM ward WHERE wType = #{wType} AND wAvailableBeds > 0 AND wState = 1")
    List<Ward> selectAvailableByType(String wType);
}
